<template>
	<b-layout-index :tabActive="2">
		<navbar bgcolor="#fff" :back="false" :title="$t('notificationCenter')"></navbar>
		<view class="bg-white">
			<u-badge numberType="overflow" :type="type" max="99" :value="value"></u-badge>
			<u-cell-group>
				<u-cell :url="'./notif/index?type='+item.key" :isLink="true" v-for="(item,index) in syss">
					<view slot="value" class="font-size-6">
						<u-badge :value="datalist.sys[item.key]" :offset="[null,10]">
						</u-badge>
					</view>
					
					<view slot="icon">
						<u-avatar name="q" fontSize="25" :isDot="true" :icon="item.icon" :bg-color="item.bg">
						</u-avatar>
					</view>
					<view slot="title" class="pd-left-5 pd-right-5  font-size-14"><text>{{item.name}}</text></view>
					<!-- 		<view slot="label" class="pd-left-5 pd-right-5 font-size-12 color-label">艾力转账了...</view> -->
				</u-cell>
			</u-cell-group>

		</view>
	</b-layout-index>
</template>

<script>
	import {
		myNotify
	} from "@/api/notify.js"
	export default {
		data() {
			return {
				syss: [{
					name: this.$t('系统通知'),
					icon: "bell-fill",
					bg: "#2979ff",
					key: "1"
				}, {
					name: this.$t('公司通知'),
					icon: "fingerprint",
					bg: "#ff9900",
					key: "2"
				}, {
					name: this.$t('订单通知'),
					icon: "order",
					bg: "#2979ff",
					key: "4"
				}, {
					name: this.$t('支付通知'),
					icon: "rmb-circle-fill",
					bg: "#ff9900",
					key: "3"
				}],
				datalist: []
			}
		},
		onLoad() {
			this.getData();
		},
		methods: {
			getData: function() {
				var the = this;
				myNotify().then(res => {
					console.log(res)
					the.datalist = res;
				})
			}
		}
	}
</script>

<style>
</style>
